package com.cc.moxingvoice.ui.other;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.KeyEvent;

import com.cc.moxingvoice.R;
import com.cc.moxingvoice.base.BaseActivity;
import com.cc.moxingvoice.databinding.ActivityWebBinding;
import com.cc.moxingvoice.lock.AppBarLock;
import com.cc.moxingvoice.lock.WebLock;

/**
 * 创建日期：2018/3/29 on 22:56
 * 描述：
 * 作者：郭士超
 * QQ：1169380200
 */

public class WebActivity extends BaseActivity {

    private ActivityWebBinding mBinding;
    private WebLock mLock;
    private AppBarLock appBarLock;

    @Override
    protected void initBinding() {
        // 数据绑定操作，可以套用代码
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_web);
        mLock = new WebLock(this, mBinding, mBundle);
        mBinding.setLock(mLock);
    }

    @Override
    protected void init() {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            if (!mLock.httpBack()) {
                finish();
            }
            return false;
        }
        return super.onKeyDown(keyCode, event);
    }

}
